package com.fan.service.Impl;

import com.fan.entity.User;
import com.fan.mapper.UserMapper;
import com.fan.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper usermapper;

    @Override
    public User login(String userName,String passWord){
        return usermapper.login(userName, passWord);
    };

    @Override
    public User selectByName(String userName){
        return usermapper.selectByName(userName);
    }
    @Override
    public int insertUser(int userId,String userName,String passWord){
        return usermapper.insertUser(userId,userName,passWord);
    }

    @Override
    public  int getCount(){
        return usermapper.getCount();
    }

    @Override
    public List<User> getAllUser() {
        return usermapper.getAllUser();
    }
}
